<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>首页</title>
</head>
<body>
<h1>This is springMVC Demo</h1>
<button id="login">登录</button>
<button id="download">下载</button>
<div> 11<%=request.getContextPath()%></div>
<a href="<%=request.getContextPath() %>/login/index1.do?param=1">登录</a>
<form id="exportData" action="<%=request.getContextPath() %>/login/downLoad.do" method="get">
    <button type="submit" value="Submit">Submit</button>
</form>
</body>
<script src="/web/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
    function exportData(previous_id){
        alert("导出:"+previous_id);
        document.getElementById("previous_id").value=previous_id;
        document.getElementById("exportData").submit();

    }
    $(document).ready(function(){
        $("#login").click(function(){
            alert("login");
            var htmlobj = $.ajax(
                {url:"/login/index",
                 async:false
                });
            $("#show").html(htmlobj.responseText);
        });
        $("#download").click(function(){
            alert("downLoad");
            var htmlobj = $.ajax(
                {url:"/login/downLoad.do",
                    async:false
                });
            //$("#show").html(htmlobj.responseText);
        });
    });
    function login() {

    }
</script>
</html>